﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using Microsoft.Practices.Unity;
using myapp.portal;
using myapp.specifications;
using myapp.stopuhr;
using myapp.wiring;

namespace myapp.winforms.host
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            // Prepare Build
            IUnityContainer uc = new UnityContainer();
            uc.RegisterType<IPortal, FrmPortal>(new ContainerControlledLifetimeManager());
            uc.RegisterType<IStopuhr, Stopuhr>();
            uc.RegisterType<MainBoard, MainBoard>();

            // Build & Bind
            var mainboard = uc.Resolve<MainBoard>();

            // Run
            Application.Run((Form)uc.Resolve<IPortal>());
        }
    }
}
